home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 126-150 / disk_147 / sys / atari / atari.zoo / chrdef.h < prev    next >
C/C++ Source or Header  |  1988-07-25  |  950b  |  37 lines

  1. /* chrdef.h -- sample character attribute macros
  2.  *
  3.  * author :  Sandra Loosemore
  4.  * date   :  26 Oct 1987
  5.  *
  6.  * This file works for the Atari ST 8-bit character set.  It probably
  7.  *    won't work for other character encodings.
  8.  *
  9.  */
  10.  
  11.  
  12. #define _W    0x01            /* Word.            */
  13. #define _U    0x02            /* Upper case letter.        */
  14. #define _L    0x04            /* Lower case letter.        */
  15. #define _C    0x08            /* Control.            */
  16. #define _P    0x10            /* end of sentence punctuation    */
  17.  
  18. #define ISWORD(c)    ((cinfo[(c)]&_W)!=0)
  19. #define ISCTRL(c)    ((cinfo[(c)]&_C)!=0)
  20. #define ISUPPER(c)    ((cinfo[(c)]&_U)!=0)
  21. #define ISLOWER(c)    ((cinfo[(c)]&_L)!=0)
  22. #define ISEOSP(c)    ((cinfo[(c)]&_P)!=0)
  23. #define TOUPPER(c)    (cupper[(c)])
  24. #define TOLOWER(c)    (clower[(c)])
  25. #define ISDIGIT(c)    (((c) >= '0') && ((c) <= '9'))
  26.  
  27. extern char cupper[];
  28. extern char clower[];
  29. extern char cinfo[];
  30.  
  31.  
  32. /*
  33.  * generally useful thing for chars
  34.  */
  35. #define CCHR(x)        ((x) ^ 0x40)    /* CCHR('?') == DEL */
  36. #define CHARMASK(c)    ((c)&0xff)
  37.